﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace ALE_Server.EC
{
    [Serializable]
    [DataContract]
    public class ECExcludePattern
    {
        private string m_Value;

        public ECExcludePattern()
        {
        }

        public ECExcludePattern(string val)
        {
            m_Value = val;
        }

        [DataMember]
        public string Value
        {
            get
            {
                return m_Value;
            }
            set
            {
                m_Value = value;
            }
        }

        public override string ToString()
        {
            return XmlSerializeHelper.Serialize(this);
        }

        public override int GetHashCode()
        {
            if (m_Value == null)
            {
                return 0;
            }

            return m_Value.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return true;
            }

            if ((obj == null) || !(obj is ECExcludePattern))
            {
                return false;
            }

            ECExcludePattern Pattern = obj as ECExcludePattern;

            return m_Value.Equals(Pattern.Value);
        }
    }
}
